package com.db4o.servlet.tools;
import javax.servlet.http.*;

public class Environment extends AbstractServlet {
	 
	public void respond(HttpServletRequest request, HttpServletResponse response) {
        final String[][] props = { { "os.name", "Operating system name" }, {
                "java.vm.vendor", "Java Virtual Machine implementation vendor" }, {
                "java.vm.version", "Java Virtual Machine implementation version" }, {
                "java.home", "Java installation directory" }, {
                "java.class.path", "Java class path" }, {
                "java.version", "Java Runtime Environment version" }, {
                "java.vendor", "Java Runtime Environment vendor" }, {
                "java.vendor.url", "Java vendor URL" }, {
                "java.vm.specification.version", "Java Virtual Machine specification version" }, {
                "java.vm.specification.vendor", "Java Virtual Machine specification vendor" }, {
                "java.vm.specification.name", "Java Virtual Machine specification name" }, {
                "java.vm.name", "Java Virtual Machine implementation name" }, {
                "java.specification.version", "Java Runtime Environment specification version" }, {
                "java.specification.vendor", "Java Runtime Environment specification vendor" }, {
                "java.specification.name", "Java Runtime Environment specification name" }, {
                "java.class.version", "Java class format version number" }, {
                "os.arch", "Operating system architecture" }, {
                "os.version", "Operating system version" }
        };
        for (int i = 0; i < props.length; i++) {
            try {
                String result = System.getProperty(props[i][0]);
                if (result != null) {

                    StringBuffer sb = new StringBuffer();
                    sb.append("<b>");
                    sb.append(props[i][1]);
                    sb.append("</b><br>");
                    sb.append(result);
                    sb.append("<br><br>");
                    println(sb.toString());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }

}
